//
//  JoinUsRecruitDetailHeaderCell.swift
//  甜言蜜语
//
//  Created by yingli_yanfa_liuxingyu on 16/8/1.
//  Copyright © 2016年 wl. All rights reserved.
//

import UIKit
protocol JoinUsRecruitDetailHeaderCellDelegate {
    func callAction()
    func reportAction()
    func ivSelected()
}
class JoinUsRecruitDetailHeaderCell: UITableViewCell {
    var delegate:JoinUsRecruitDetailHeaderCellDelegate?
    @IBOutlet weak var titleLbl: UILabel!//标题
    @IBOutlet weak var payLbl: UILabel!//工资
    @IBOutlet weak var ptimeLbl: UILabel!//发布时间
    @IBOutlet weak var browernumLbl: UILabel!//浏览数
    @IBOutlet weak var positiontypeLbl: UILabel!//职位
    @IBOutlet weak var liftLbl: UILabel!//经验
    @IBOutlet weak var educationLbl: UILabel!//学历
    @IBOutlet weak var unitcompanyLbl: UILabel!//公司名称
    @IBOutlet weak var sizeLbl: UILabel!//公司大小
    @IBOutlet weak var unittypeLbl: UILabel!//行业
    @IBOutlet weak var unitaddressLbl: UILabel!//地址
    @IBOutlet weak var telLbl: UILabel!//电话
    @IBOutlet weak var requirementLbl: UILabel!//职位描述
    @IBOutlet weak var workArea: UILabel!//工作区域
    @IBOutlet weak var advertisersIv: UIImageView!//发布人投降
    @IBOutlet weak var advertisersName: UILabel!//发布人昵称
    
    @IBOutlet weak var membertypecn: UILabel!
    @IBOutlet weak var requiredLblCons: NSLayoutConstraint!
    override func awakeFromNib() {
        super.awakeFromNib()
        self.advertisersIv.layer.cornerRadius = 16.5
        self.advertisersIv.layer.masksToBounds = true
        // Initialization code
    }
    func setCellText(text: String){
        let font = UIFont(name: "Helvetica", size: 14)
        
        if text == ""{
            self.requiredLblCons.constant = 0
        }else{
            self.requiredLblCons.constant = publicMethod.getLabHeigh((text), font:font!, width:SCREEN_WIDTH - 16) + 20
        }
        self.requirementLbl.layoutIfNeeded()
    }
    override func setSelected(selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    @IBAction func callBtnClicked(sender: UIButton){
        delegate?.callAction()
    }
    @IBAction func reportClicked(sender: UIButton){
        delegate?.reportAction()
    }
    @IBAction func ivTap(sender: UIButton) {
        delegate?.ivSelected()
    }
    
}
